<?php
    // 8/15/2009: Immanuel192 write this config class
    class albummodule_config {
        function form($object) {
            if (!defined('SYS_FORMS')) require_once(BASE.'subsystems/forms.php');
            exponent_forms_initialize();

            $form = new form();
            if (!isset($object->id)) {
                $object->item_per_page=10;
                $object->show_first_only=0;
                $object->demo_collection=0;		 	 	 	 	 	 	 
                $object->hquality_collection=0;		 	 	 	 	 	 	 
                $object->track_collection=0;		 	 	 	 	 	 	 
                $object->sheet_collection=0;		 	 	 	 	 	 	 
                $object->tongpho_collection=0;		 	 	 	 	 	 	 
                $object->album_type=0;
                $object->music_per_page = 10;
                $object->album_collection=0;
            } else {
                $form->meta('id',$object->id);
            }
            $album_type[0]='Christian';
            $album_type[1]='Others';
            $form->register('album_type',"Album Type",new dropdowncontrol($object->album_type,$album_type));
            $form->register('item_per_page',"Item per page",new textcontrol($object->item_per_page));
            $form->register('music_per_page',"Music item per page",new textcontrol($object->music_per_page));
            $form->register('show_first_only','Show detail of first album only',new checkboxcontrol($object->show_first_only));
            $form->register('album_collection',"Album Cover Collection",new file_collection_control($object->album_collection));
            //$form->register('demo_collection',"Demo File Collection",new file_collection_control($object->demo_collection));		
            $form->register('hquality_collection',"High Quality File Collection",new file_collection_control($object->hquality_collection));
            //$form->register('track_collection',"Sound Track Mix File Collection",new file_collection_control($object->track_collection));
            //$form->register('sheet_collection',"Sheet File Collection",new file_collection_control($object->sheet_collection));
            //$form->register('tongpho_collection',"TongPho File Collection",new file_collection_control($object->tongpho_collection));
            //$form->register("","",new htmlcontrol("<br><input type=button value='Update songs Information' onclick='alert(\"FixME:\");'><br>"));
            $form->register('submit','',new buttongroupcontrol('Save','','Cancel'));
            return $form;
        }

        function update($values,$object) {
            $object->album_type = $values['album_type'];
            $object->item_per_page = $values['item_per_page'];
            $object->show_first_only = $values['show_first_only'];
            $object->music_per_page = $values['music_per_page'];
            //$object->demo_collection = $values['demo_collection'];
            $object->hquality_collection = $values['hquality_collection'];
            $object->album_collection= $values['album_collection'];
            //$object->track_collection = $values['track_collection'];
            //$object->sheet_collection = $values['sheet_collection'];
            //$object->tongpho_collection = $values['tongpho_collection'];
            return $object;
        }
    }

?>
